//
//  Distric.m
//  课堂代码Two
//
//  Created by dllo on 16/7/11.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "Distric.h"

@implementation Distric
- (instancetype)initWithName:(NSString *)name {
          return [self initWithName:name number:nil];
}
+ (instancetype)districtWithName:(NSString *)name {
          return [[self alloc] initWithName:name];
}
- (NSString *)description {
      return [NSString stringWithFormat:@"%@",_name];
}

- (instancetype)initWithName:(NSString *)name
                      number:(NSString *)number {
      if (self = [super init]) {
            _name = name;
            _number = number;
      }
      return self;
}
+ (instancetype)districtWithName:(NSString *)name
                          number:(NSString *)number {
      return [[Distric alloc] initWithName:name number:number];
}
- (instancetype)initWithTimeCity:(TimeCity *)timeCity {
      return [self initWithName:timeCity.name number:timeCity.cityNumber];
}

+ (instancetype)districWithTimeCity:(TimeCity *)timeCity {
      return [[self alloc] initWithTimeCity:timeCity];
}

@end
